home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / tabarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  4.9 KB  |  196 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_TABARRAY_H
  4. #define _PANGOMM_TABARRAY_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* $Id: tabarray.hg,v 1.2 2003/01/22 12:10:11 murrayc Exp $ */
  9.  
  10. /* tabarray.h
  11.  *
  12.  * Copyright (C) 1998-1999 The gtkmm Development Team
  13.  *
  14.  * This library is free software; you can redistribute it and/or
  15.  * modify it under the terms of the GNU Library General Public
  16.  * License as published by the Free Software Foundation; either
  17.  * version 2 of the License, or (at your option) any later version.
  18.  *
  19.  * This library is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.  * Library General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU Library General Public
  25.  * License along with this library; if not, write to the Free
  26.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  */
  28.  
  29. #include <pangomm/attrlist.h>
  30. #include <pango/pango-tabs.h>
  31. #include <pango/pango-break.h> //For PangoLogAttrs.
  32.  
  33. #include <utility>
  34. #include <glibmmconfig.h>
  35. GLIBMM_USING_STD(pair)
  36.  
  37.  
  38. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  39. extern "C" { typedef struct _PangoTabArray PangoTabArray; }
  40. #endif
  41.  
  42. namespace Pango
  43. {
  44.  
  45.  
  46. /** @addtogroup pangommEnums Enums and Flags */
  47.  
  48. /**
  49.  * @ingroup pangommEnums
  50.  */
  51. enum TabAlign
  52. {
  53.   TAB_LEFT
  54. };
  55.  
  56. } // namespace Pango
  57.  
  58.  
  59. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  60. namespace Glib
  61. {
  62.  
  63. template <>
  64. class Value<Pango::TabAlign> : public Glib::Value_Enum<Pango::TabAlign>
  65. {
  66. public:
  67.   static GType value_type() G_GNUC_CONST;
  68. };
  69.  
  70. } // namespace Glib
  71. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  72.  
  73.  
  74. namespace Pango
  75. {
  76.  
  77.  
  78. /** A Pango::TabArray contains an array of tab stops.
  79.  * Each tab stop has an alignment and a position.
  80.  */
  81. class TabArray
  82. {
  83.   public:
  84. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  85.   typedef TabArray CppObjectType;
  86.   typedef PangoTabArray BaseObjectType;
  87.  
  88.   static GType get_type() G_GNUC_CONST;
  89. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  90.  
  91.   TabArray();
  92.  
  93.   explicit TabArray(PangoTabArray* gobject, bool make_a_copy = true);
  94.  
  95.   TabArray(const TabArray& other);
  96.   TabArray& operator=(const TabArray& other);
  97.  
  98.   ~TabArray();
  99.  
  100.   void swap(TabArray& other);
  101.  
  102.   ///Provides access to the underlying C instance.
  103.   PangoTabArray*       gobj()       { return gobject_; }
  104.  
  105.   ///Provides access to the underlying C instance.
  106.   const PangoTabArray* gobj() const { return gobject_; }
  107.  
  108.   ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
  109.   PangoTabArray* gobj_copy() const;
  110.  
  111. protected:
  112.   PangoTabArray* gobject_;
  113.  
  114. private:
  115.  
  116.   
  117. public:
  118.   explicit TabArray(int initial_size, bool positions_in_pixels = true);
  119.  
  120.   
  121.   /** Gets the number of tab stops in @a tab_array .
  122.    * @return The number of tab stops in the array.
  123.    */
  124.   int get_size() const;
  125.   
  126.   /** Resizes a tab array. You must subsequently initialize any tabs that
  127.    * were added as a result of growing the array.
  128.    * @param new_size New size of the array.
  129.    */
  130.   void resize(int new_size);
  131.   
  132.   /** Sets the alignment and location of a tab stop.
  133.    *  @a alignment  must always be Pango::TAB_LEFT in the current
  134.    * implementation.
  135.    * @param tab_index The index of a tab stop.
  136.    * @param alignment Tab alignment.
  137.    * @param location Tab location in pango units.
  138.    */
  139.   void set_tab(int tab_index, TabAlign alignment, int location);
  140.  
  141.   /** Gets the alignment and position of a tab stop.
  142.    * @return An std::pair<TabAlign, int>. The first element represents the tab stop alignment, the second one is the tab position.
  143.    */
  144.   std::pair<TabAlign,int> get_tab(int tab_index) const;
  145.  
  146.   /** Gets an array of std::pairs containing the tab stop alignments and tab positions.
  147.    * @return An array of std::pair<TabAlign, int>. The first element in each pair represents the tab stop alignment, the second one is the tab position.
  148.    */
  149.   Glib::ArrayHandle< std::pair<TabAlign,int> > get_tabs() const;
  150.  
  151.   
  152.   /** Returns <tt>true</tt> if the tab positions are in pixels, <tt>false</tt> if they are
  153.    * in Pango units.
  154.    * @return Whether positions are in pixels.
  155.    */
  156.   bool get_positions_in_pixels() const;
  157.  
  158.  
  159. };
  160.  
  161. } //namespace Pango
  162.  
  163.  
  164. namespace Pango
  165. {
  166.  
  167. /** @relates Pango::TabArray
  168.  * @param lhs The left-hand side
  169.  * @param rhs The right-hand side
  170.  */
  171. inline void swap(TabArray& lhs, TabArray& rhs)
  172.   { lhs.swap(rhs); }
  173.  
  174. } // namespace Pango
  175.  
  176. namespace Glib
  177. {
  178.  
  179. /** @relates Pango::TabArray
  180.  * @param object The C instance
  181.  * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  182.  * @result A C++ instance that wraps this C instance.
  183.  */
  184. Pango::TabArray wrap(PangoTabArray* object, bool take_copy = false);
  185.  
  186. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  187. template <>
  188. class Value<Pango::TabArray> : public Glib::Value_Boxed<Pango::TabArray>
  189. {};
  190. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  191.  
  192. } // namespace Glib
  193.  
  194. #endif /* _PANGOMM_TABARRAY_H */
  195.  
  196.